const seq = require('../connections/mysql_connect'),
      { STRING, INT, DECIMAL, TEXT } = require('../../config/db_type_config');

const User = seq.define('user', {
  uid: {
    content: 'user id',
    type: STRING,
    allowNull: false,
    unique: true
  },
  password: {
    content: 'password',
    type: STRING,
    allowNull: false
  },
  nickname: {
    content: 'nickname',
    type: STRING,
    allowNull: false
  },
  phone: {
    content: 'phone',
    type: STRING,
    defaultValue: '未填写',
    allowNull: true
  },
  level: {
    content: 'level',
    type: INT,
    defaultValue: 0,
    allowNull: true
  },
  resolve_num: {
    content: 'resolve_num',
    type: INT,
    defaultValue: 0,
    allowNull: true
  },
  submit_num: {
    content: 'submit_num',
    type: INT,
    defaultValue: 0,
    allowNull: true
  },
  isBasic: {
    content: 'submit_num',
    type: INT,
    defaultValue: 1,
    allowNull: true
  },
  recom_amount: {
    content: '',
    type: INT,
    defaultValue: 10,
    allowNull: true
  }
})


module.exports = User;